Skip to content

Modify in_bits to check in_valid before accessing#2228

Merged
aswaterman merged 1 commit intoriscv-software-src:masterfrom
abejgonzalez:patch-2
Feb 10, 2026
Merged

Modify in_bits to check in_valid before accessing#2228
aswaterman merged 1 commit intoriscv-software-src:masterfrom
abejgonzalez:patch-2

Conversation

@abejgonzalez
Copy link
Contributor

Instead of retrieving stale data, if the valid is false then return 0. This avoids cases where the downstream testbench might read this data when there is none, causing a runtime error. While it's still up to the downstream code to properly verify that it doesn't use the bits, this avoids runtime errors (e.g., segfaults when accessing empty containers).

Signed-off-by: Abraham Gonzalez <abe.j.gonza@gmail.com>
@aswaterman aswaterman merged commit 875a7ee into riscv-software-src:master Feb 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants